package Java实验.实验三;

import java.util.Objects;
import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string = scanner.next();
        if (Objects.equals(string,"学生")) {
            Student student = new Student();
            student.introduction();
        }
        else if (Objects.equals(string, "老师")) {
            Teacher teacher = new Teacher();
            teacher.introduction();
        }

    }
}

/********** Begin *********/
interface Introduce {
    void introduction();
}

class Student implements Introduce {
    public void introduction(){
        System.out.println("我是一名学生！");
    }
}

class Teacher implements Introduce {
    public void introduction(){
        System.out.println("我是一名老师！");
    }
}
/********** End *********/
